/* 考勤管理系统统一样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* 侧边栏样式 */
.sidebar {
    background: var(--sidebar-bg);
    color: white;
    min-height: 100vh;
    position: fixed;
    width: 250px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.9);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1.1em;
}

.sidebar-brand {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h4 {
    margin: 0;
    font-weight: 600;
}

.sidebar-brand small {
    opacity: 0.8;
    font-size: 0.85em;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8em;
    opacity: 0.7;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
}

/* 导航栏 */
.navbar-custom {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--secondary-color);
}

/* 统计卡片 */
.stat-card {
    border-radius: 0.75rem;
    border: none;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* 按钮样式 */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
}

.btn-warning {
    background: var(--warning-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-info {
    background: var(--info-color);
}

/* 表格样式 */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--secondary-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

/* 徽章样式 */
.badge {
    border-radius: 0.25rem;
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0;
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 0.75rem 0.75rem;
    padding: 1.25rem;
}

/* 日历样式 */
.calendar {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
}

.calendar-weekdays {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.calendar-weekdays .col {
    padding: 0.75rem;
    border: none;
}

.calendar-days {
    background: white;
}

.calendar-day {
    min-height: 80px;
    border: 1px solid #e9ecef;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
}

.calendar-day .day-number {
    font-weight: 600;
    font-size: 1.1em;
    text-align: center;
}

.calendar-day .attendance-stats {
    font-size: 0.75em;
    opacity: 0.8;
    text-align: center;
    margin-top: auto;
}

/* 确保日历行正确显示 */
.calendar-days.row {
    margin: 0;
}

.calendar-days .col {
    padding: 0;
    flex: 1 0 14.2857%; /* 7列等分 */
    max-width: 14.2857%;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* 时间区域样式 */
.time-section {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.time-section h6 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* 分页样式 */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 0.2rem;
    border: none;
    color: var(--secondary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 警告框样式 */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .calendar-day {
        min-height: 60px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
